<h2>Example Applications:</h2>
<hr>
<h3>Test lineament formation hypotheses:</h3>
  <ul>
    <li>Given:
      <ul>
        <li>Satellite</li>
        <li>StressDef</li>
        <li>Lineament</li>
        <li>FailureMode</li>
      </ul>
    <li>Calculate:
      <ul>
        <li>A metric of the likelihood that that Lineament is the result of
        that FailureMode on that Satellite.</li>
        <li>Allow optional inclusion of geographic Lineament transformations:
          <ul>
            <li>Longitudinal translation due to NSR</li>
            <li>Free shell reorientation (Future)</li>
          </ul></li>
      </ul>
   <li>Answer will depend on whether the Satellite is subject to time-variable
   Stresses (i.e. whether it has an eccentric orbit... diurnal tides).</li>
   <li>Answer must also depend on the likelihood of such a lineament matching
   the specified environment by chance (yields a confidence interval).</li>
   <li>If FailureMode is dynamic, then many synthetic lineaments will have
   to be created to test the hypothesis (simple comparison doesn't work)</li>
  </ul>

<h3>Compare Lineaments to each other:</h3>
  <ul>
    <li>Given:
      <ul>
        <li>Lineaments A and B</li>
      </ul>
    <li>Calculate:
      <ul>
        <li>a metric of their similarity (e.g. SMHD)</li>
      </ul>
    <li>Allow optional inclusion of geographic Lineament transformations:
      <ul>
        <li>Longitudinal translation due to NSR</li>
        <li>Free shell reorientation (Future)</li>
      </ul>
  </ul>

<h3>Creation of synthetic populations of lineaments:</h3>
  <ul>
    <li>Given:
      <ul>
        <li>Satellite</li>
        <li>StressDef</li>
        <li>FailureMode</li>
        <li>Lineament characteristics:
        <ul>
          <li>Length overall</li>
          <li>Geographic location</li>
          <li>Fourier power spectrum (wiggliness)</li>
        </ul></li>
      </ul></li>
    <li>Generate:
      <ul>
        <li>A given number of lineaments known to be consistent with the inputs.</li>
      </ul></li>
    <li>Allow the insertion of systemic noise, perturbing the lineament
    population by a controlled amount from "perfect" consistency with the
    input parameters.</li>
    <li>Should also allow the creation of lineament populations that are
    unrelated to any stress field, for comparison purposes:
    <ul>
      <li>random great circles</li>
    </ul></li>
  </ul>

<h3>Extract crosscutting relationships from populations with known histories:</h3>
  <ul>
    <li>Given a population of lineaments and a known order of formation, return
    the graph that describes their crosscutting relationships.</li>
    <li>Allow the insertion of "noise" into the system, such that the
    confidences of the intersections are less than one, and such that the
    apparent order of formationof the lineaments is sometimes wrong.</li>
  </ul>

<h3>Infer the most likely histories from a graph and its Lineaments:</h3>
  <ul>
    <li>Details of this mess are described elsewhere</li>
  </ul>

<h2>Relationships between these components:</h2>
<ul>
  <li>Satellite + PlaceTime + StressDef =&gt; SurfStress
  <li>Satellite + StressDef =&gt; Love
  <li>StressDef may or may not depend on Satellite for forcing frequencies
  which are a function of the physical setting (e.g. Diurnal).</li>
  <li>A Lineament:
    <ul>
      <li>may be derived from a mapped feature (and thus depend on nothing)</li>
      <li>may be derived from SurfStress (defined above)</li>
      <li>will still depend on a PlaceTime, even if the StressDef that is used
      in generating the SurfStress is not time dependent (e.g. NSR) because it
      has to have a location (A point which the lineament is known to pass
      through)</li>
    </ul></li>
  <li>CrossCutGraph may:
    <ul>
      <li>be stand-alone (mapped)</li>
      <li>Be a property of an ordered list of Lineaments</li>
    </ul></li>
</ul>

</body>
</html>
<!--
Computational Efficiency and Language Choice:
=============================================
The only reason not to write any of this in Python is that it's not the most
computationally efficient.  Which parts of the overall process are likely
require that efficiency?

  - Calculation of the actual stresses
  - Neighborhood Algorithm search for good matches between model and
    synthetic lineaments in the time-variable stress case (I have Fortran
    code from Malcom Sambridge that does this)
  - Comparison of lineament shapes (using SMHD)
  - Potentially any recursive parts of the graph algorithm

======================
LatLonPt:
======================
  Data Members:
    - latlon tuple (lat,lon)

  Initialization:
    - from two floating point numbers
    - from an existing LatLonPt

  Methods:
    - calc_ang_dist(self, llp2)
    - calc_azimuth(self, llp2)

======================
Lineament:
======================
  Data Members:
    - lin_id (unique identifying string, generated by us)
    - orig_lin_id (lin_id that we read in from the file, not unique)
    - point_list (list of all LatLonPt objects making up the lineament)

  Dependent data:
    - netlength (distance between one end and the other)
    - grosslength (length of the entire lineament)
    - sinuosity (grosslength/netlength)

  Initialization:
    - From an ESRI generate file
    - From a provided list of LatLonPt objects, and a LIN_ID
    - From an existing Lineament object

  Methods:
    - translate(self, theta, phi)  Only allowing theta==0 for now.
    - calc_mhd(self, lin2)
    - calc_smhd(self, lin2)

    - intersect_point(self, lin2) If yes, return LatLonPt at which we do.
    - intersect_segment(self, lin2) If yes, return 2 LatLonPt objects
      between which the intersection occurs.
    - split(self, llp1, llp2) where llp1 and llp2 are LatLonPt objects.
      All lineament segments between them are removed, and two Lineament
      objects are returned, corresponding to the remaining segments.

======================
SatStressRun:
======================
  Data Members:
    - path to the input file describing the stress field

  Initialization:
    - from an input file
    - from a filehandle
    - from an existing SatStressField object
    - from a RUN_ID (via the web!)

  Methods:
    - rms_misfit(self, lin)  Keep the guts hidden for future improvement.

======================
nsrfithist.py
======================
This program will use the above classes in order to analyze the distribution of
lineaments across a variety of NSR fields.

Inputs:
  - a set of mapped lineaments (as a .gen file)
  - minimum lineament length
  - maximum acceptable rms_misfit
  - an input file defining a stress field
  - NSR bin size (which is also the backrotation increment)

Outputs:
  - PDF histogram (via gnuplot) showing the cumulative length of the lineaments
    formed within each bin of backrotation.
  - CSV file that can be imported back into GIS, containing:
    - LIN_ID
    - best fit backrotation for each lineament
    - rms_misfit for each lineament

Difficulties:
  - How do we link disjoint portions of lineaments for analysis?
    (many of the lineaments cross the +/- 180 meridian, and so have been
    split...)
    -->

